package com.mycat.auth.domain;


import com.mycat.auth.domain.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * 浠ｇ爜鐢熸垚鍣ㄨ嚜鍔ㄧ敓鎴�
 * Date:2016-8-26 16:02:39
 *
 * @author Roger
 */
@Table(name = "sys_admin")
public class Admin extends BaseEntity {
    @Column(name = "fd_userName")
    private String userName; // 登录名
    @Column(name = "fd_pswd")
    private String pswd; // 密码
    @Column(name = "fd_salt")
    private String salt; // 盐值
    @Column(name = "fd_cellphone")
    private String cellphone; // 手机号
    @Column(name = "fd_email")
    private String email; // 邮箱
    @Column(name = "fd_name")
    private String name; // 姓名
    @Column(name = "fd_nickName")
    private String nickName; // 昵称
    @Column(name = "fd_photo")
    private String photo; // 头像
    @Column(name = "fd_gender")
    private String gender; // 性别(Male-男、Female-女)
    @Column(name = "fd_remark")
    private String remark; // 备注
    @Column(name = "fd_state")
    private String state; // 账号状态(unactivity-未激活、normal-正常、locked-已锁定、out-已注销)
    @Column(name = "fd_loginCount")
    private Integer loginCount; // 登录次数
    @Column(name = "fd_lastActivity")
    private Date lastActivity; // 最近活动时间
    @Transient
    private List<Role> roles;

    @Override
    public String toString() {
        return "Admin{" +
                "lastActivity=" + lastActivity +
                ", userName='" + userName + '\'' +
                ", pswd='" + pswd + '\'' +
                ", salt='" + salt + '\'' +
                ", cellphone='" + cellphone + '\'' +
                ", email='" + email + '\'' +
                ", name='" + name + '\'' +
                ", nickName='" + nickName + '\'' +
                ", photo='" + photo + '\'' +
                ", gender='" + gender + '\'' +
                ", remark='" + remark + '\'' +
                ", state='" + state + '\'' +
                ", loginCount=" + loginCount +
                '}';
    }

    public Admin() {
    }

    public Admin(Integer id) {
        super.setId(id);
    }

    public Admin(String userName) {
        this.userName = userName;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    /**
     * 鑾峰彇  登录名
     *
     * @return userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * 璁剧疆  登录名
     *
     * @param userName
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * 鑾峰彇  密码
     *
     * @return pswd
     */
    public String getPswd() {
        return pswd;
    }

    /**
     * 璁剧疆  密码
     *
     * @param pswd
     */
    public void setPswd(String pswd) {
        this.pswd = pswd;
    }

    /**
     * 鑾峰彇  手机号
     *
     * @return cellphone
     */
    public String getCellphone() {
        return cellphone;
    }

    /**
     * 璁剧疆  手机号
     *
     * @param cellphone
     */
    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    /**
     * 鑾峰彇  邮箱
     *
     * @return email
     */
    public String getEmail() {
        return email;
    }

    /**
     * 璁剧疆  邮箱
     *
     * @param email
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * 鑾峰彇  姓名
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 璁剧疆  姓名
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 鑾峰彇  昵称
     *
     * @return nickName
     */
    public String getNickName() {
        return nickName;
    }

    /**
     * 璁剧疆  昵称
     *
     * @param nickName
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 鑾峰彇  头像
     *
     * @return photo
     */
    public String getPhoto() {
        return photo;
    }

    /**
     * 璁剧疆  头像
     *
     * @param photo
     */
    public void setPhoto(String photo) {
        this.photo = photo;
    }

    /**
     * 鑾峰彇  性别(Male-男、Female-女)
     *
     * @return gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * 璁剧疆  性别(Male-男、Female-女)
     *
     * @param gender
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    /**
     * 鑾峰彇  备注
     *
     * @return remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * 璁剧疆  备注
     *
     * @param remark
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * 鑾峰彇  账号状态(unactivity-未激活、normal-正常、locked-已锁定、out-已注销)
     *
     * @return state
     */
    public String getState() {
        return state;
    }

    /**
     * 璁剧疆  账号状态(unactivity-未激活、normal-正常、locked-已锁定、out-已注销)
     *
     * @param state
     */
    public void setState(String state) {
        this.state = state;
    }

    /**
     * 鑾峰彇  登录次数
     *
     * @return loginCount
     */
    public Integer getLoginCount() {
        return loginCount;
    }

    /**
     * 璁剧疆  登录次数
     *
     * @param loginCount
     */
    public void setLoginCount(Integer loginCount) {
        this.loginCount = loginCount;
    }

    /**
     * 鑾峰彇  最近活动时间
     *
     * @return lastActivity
     */
    public Date getLastActivity() {
        return lastActivity;
    }

    /**
     * 璁剧疆  最近活动时间
     *
     * @param lastActivity
     */
    public void setLastActivity(Date lastActivity) {
        this.lastActivity = lastActivity;
    }


    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }
}